﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wucLookup.ascx.cs" Inherits="SD.Web.Views.Contacts.wucLookup" %>
<asp:Panel runat="server" ID="PanelContainer" CssClass="" Visible="false">
    <%--    <asp:UpdatePanel ID="ContactListUpdatePanel" runat="server" UpdateMode="Always">
            <ContentTemplate>--%>
                <div class="grid740 simplebox popup" style="z-index: 900;">
                    <div class="titleh">
                        <h3>Search Contact</h3>
                    </div>
                    <div class="body">
                        <div class="st-form-line">
                            <div class="half">
                                <asp:Label ID="FirstNameLabel" CssClass="st-labeltext" runat="server" Text="First Name"
                                    AssociatedControlID="txtFirstName"></asp:Label>
                                <asp:TextBox ID="txtFirstName" CssClass="st-forminput" runat="server" 
                                    Width="200px"></asp:TextBox>
                            </div>
                            <div class="half">
                                <asp:Label ID="LabelName" runat="server" CssClass="st-labeltext" Text="SurName"></asp:Label>
                                <asp:TextBox ID="txtSurname" runat="server" CssClass="st-forminput" 
                                    Width="200px"></asp:TextBox>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                        <div class="button-box">
                            <asp:Button ID="btnSearchContact" runat="server" Text="Search" CssClass="st-button"
                                CausesValidation="False" />
                        </div>
                        <div class="st-form-line">
                            <div class="titleh">
                                <h3>
                                    <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active contact ?"
                                        AutoPostBack="True" /></h3>
                            </div>

                            <asp:GridView ID="ContactGridView" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                                DataKeyNames="ContactID" AllowPaging="true" PageSize="5" 
                                DataSourceID="ContactObjectDataSource" AllowSorting="true">
                                <Columns>
                                    
                                    <asp:TemplateField HeaderText="">
                                        <ItemTemplate>                                            
                                            <input id="Radio1" type="radio" name="MyRadioButton" value='<%#Eval("ContactId")%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Contact Name" SortExpression="ContactName">
                                        <ItemTemplate>
                                            <%# string.Format("{0} {1}", Eval("FirstName"), Eval("Surname")) %>
                                        </ItemTemplate>
                                        <HeaderStyle CssClass="header" />
                                    </asp:TemplateField>
                                    <asp:BoundField HeaderText="Mobile Phone" DataField="MobilePhone" SortExpression="MobilePhone">
                                        <HeaderStyle CssClass="header" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="Email" DataField="Email" SortExpression="Email">
                                        <HeaderStyle CssClass="header" />
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="Contact Type" SortExpression="ContactTypeName">
                                        <ItemTemplate>
                                            <%# Eval("ContactType.ContactTypeName") %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Is Active?" SortExpression="IsActive">
                                        <ItemTemplate>
                                            <%# (bool)Eval("IsActive") ? "Yes" : "No" %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <PagerStyle CssClass="pagination_table" />
                            </asp:GridView>

                            <asp:ObjectDataSource ID="ContactObjectDataSource" runat="server" EnablePaging="true" SelectCountMethod="CountContact"
                MaximumRowsParameterName="maximumRows" StartRowIndexParameterName="startRowIndex" SortParameterName="sortType"
                SelectMethod="GetListContact" TypeName="SD.Business.ContactBUS">
                <SelectParameters>
                    <asp:ControlParameter ControlID="CheckBoxInactive" DefaultValue="false" Name="filter"
                        PropertyName="Checked" Type="Boolean" />
                    <asp:ControlParameter ControlID="txtFirstName" DefaultValue="" Name="firstName" PropertyName="Text"
                        Type="String" />
                    <asp:ControlParameter ControlID="txtSurName" Name="surName" PropertyName="Text" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>

                            <br />
                            <div class="">
                                <asp:Button ID="btnSelect" runat="server" Text="Select" CssClass="st-button" CausesValidation="False"
                                    OnClick="btnSelect_Click" />
                                <asp:Button ID="btnEdit" runat="server" Text="Edit" CssClass="st-button" CausesValidation="False"
                                    OnClick="btnEdit_Click" />
                                <asp:Button ID="btnClose" runat="server" Text="Close" CssClass="st-button" CausesValidation="False"
                                    OnClick="btnClose_Click" />
                            </div>
                        </div>
                    </div>
                </div>
            
           <%-- </ContentTemplate>
        </asp:UpdatePanel>--%>
        <div class="clear">
        </div>
    </asp:Panel>    